<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>真实合同管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#btnExport").click(
						function() {
							top.$.jBox.confirm("确认要导出产品数据吗？", "系统提示", function(
									v, h, f) {
								if (v == "ok") {
									$("#searchForm").attr("action",
											"${ctx}/pro/realContract/export");
									$("#searchForm").submit();
								}
							}, {
								buttonsFocus : 1
							});
							top.$('.jbox-body .jbox-icon').css('top', '55px');
						});
				$("#btnImport").click(function() {
					$.jBox($("#importBox").html(), {
						title : "导入数据",
						buttons : {
							"关闭" : true
						},
						bottomText : "导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"
					});
				});
			});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").attr("action", "${ctx}/pro/realContract/list");
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<div id="importBox" class="hide">
		<form id="importForm" action="${ctx}/pro/realContract/import"
			method="post" enctype="multipart/form-data" class="form-search"
			style="padding-left: 20px; text-align: center;"
			onsubmit="loading('正在导入，请稍等...');">
			<br /> <input id="uploadFile" name="file" type="file"
				style="width: 330px" /><br />
			<br /> <input id="btnImportSubmit" class="btn btn-primary"
				type="submit" value="   导    入   " /> <a
				href="${ctx}/pro/realContract/import/template">下载模板</a>
		</form>
	</div>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/pro/realContract/">合同列表</a></li>
		<shiro:hasPermission name="pro:realContract:edit">
			<li><a href="${ctx}/pro/realContract/form">合同添加</a></li>
		</shiro:hasPermission>
	</ul>
		<form:form id="searchForm" modelAttribute="realContract" action="${ctx}/pro/realContract/list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
		<ul class="ul-form">
			<li>
				<label>客户名称：</label>
				<form:select path="clientele" class="input-medium">
					<form:option value="" label="全部"/>
					<form:options items="${fns:getClienteleList()}" itemLabel="name" itemValue="id" htmlEscape="false" />
				</form:select>
			<li>
			<li>
				<label>合同订单号：</label>
				<form:input path="code" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li class="btns">
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
			</li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable"
		class="table tablesorter table-striped table-bordered table-condensed " style="word-wrap:break-all;word-break:break-all;">
		<thead>
			<tr>
				<th>合同号</th>
				<th>备注</th>
				<th>更新时间</th>
				<shiro:hasPermission name="pro:realContract:edit">
					<th>操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="realContract">
				<tr>
					<td><a href="${ctx}/pro/realContract/form?id=${realContract.id}">
							${realContract.code} </a></td>
					<td>${realContract.remarks}</td>
					<td><fmt:formatDate value="${realContract.updateDate}"
							pattern="yyyy-MM-dd HH:mm:ss" /></td>
					<shiro:hasPermission name="pro:realContract:edit">
						<td><a href="${ctx}/pro/realContract/form?id=${realContract.id}">修改</a>
							<a href="${ctx}/pro/realContract/delete?id=${realContract.id}"
							onclick="return confirmx('确认要删除该合同号吗？', this.href)">删除</a></td>
					</shiro:hasPermission>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>